<html>
<head><meta charset="utf-8"><title>Split DWARF and std · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Split.20DWARF.20and.20std.html">Split DWARF and std</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="220616844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Split%20DWARF%20and%20std/near/220616844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Split.20DWARF.20and.20std.html#220616844">(Dec 21 2020 at 18:54)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="116107">@davidtwco</span> </p>
<p>Now that rustc supports split DWARF, what would it take to use that for compiling the std that we ship for each target? That would make it easier to build binaries without debug symbols, and not end up with all the symbols from std anyway.</p>



<a name="220622108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Split%20DWARF%20and%20std/near/220622108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Split.20DWARF.20and.20std.html#220622108">(Dec 21 2020 at 19:42)</a>:</h4>
<p>I'll let David answer for split DWARF specifically but <span class="user-mention" data-user-id="116015">@Alex Crichton</span> has proposed stabilizing a <code>-Csplit-debuginfo</code> flag in <a href="https://github.com/rust-lang/rust/issues/79570">#79570</a>. So there's probably a lot of overlap with that.</p>



<a name="220734999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Split%20DWARF%20and%20std/near/220734999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Split.20DWARF.20and.20std.html#220734999">(Dec 22 2020 at 21:15)</a>:</h4>
<p>I was intending to look into something like this once beta rustc had Split DWARF in it - adding support for bootstrap to compile rustc itself in Split DWARF. </p>
<p>My background of how we distribute std is fuzzy, but: if we ship std as an rlib, then if final compiler invocation (which produces the shared library or binary) is invoked with Split DWARF then std's debuginfo would be split in the output of that. If that understanding is correct, then I don't know that it "shipping std with Split DWARF" is meaningful.</p>



<a name="220735572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Split%20DWARF%20and%20std/near/220735572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Split.20DWARF.20and.20std.html#220735572">(Dec 22 2020 at 21:22)</a>:</h4>
<p>I think we ship an rlib for generic functions and an .so for non-generic ones</p>



<a name="220735598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Split%20DWARF%20and%20std/near/220735598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Split.20DWARF.20and.20std.html#220735598">(Dec 22 2020 at 21:23)</a>:</h4>
<p>(or generic functions that are unreachable from the root - I'm sure you know more about that than I do)</p>



<a name="220737772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Split%20DWARF%20and%20std/near/220737772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Split.20DWARF.20and.20std.html#220737772">(Dec 22 2020 at 21:50)</a>:</h4>
<p>The .so version of libstd is used when you either use -Cprefer-dynamic or any crate in the crate graph is only available as dylib. Eg <a href="http://librustc_driver.so">librustc_driver.so</a>.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>